﻿using Rubyer;
using System.Windows.Controls;

namespace GetMan.Views
{
    /// <summary>
    /// MainView.xaml 的交互逻辑
    /// </summary>
    public partial class MainView : RubyerWindow
    {
        public MainView()
        {

            InitializeComponent();
        }

        private void RawContentTextBox_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {
            var textBox = (TextBox)sender;
            if (textBox == null)
                return;
            if (e.Key == System.Windows.Input.Key.Tab)
            {
                int caretIndex = textBox.CaretIndex;
                textBox.Text = textBox.Text.Insert(caretIndex, "\t");
                textBox.CaretIndex = caretIndex + 1;
                e.Handled = true;
            }
        }

    }

}
